-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WEBDEV-5328 Integrate search service with beta search backend #16
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #16 +/- ##
==========================================
+ Coverage 75.35% 79.90% +4.54%
==========================================
Files 20 24 +4
Lines 1331 1891 +560
Branches 26 118 +92
==========================================
+ Hits 1003 1511 +508
- Misses 326 374 +48
- Partials 2 6 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR overhauls the internals of the search service to point at the beta Page Production Service (PPS) instead of the advanced_search.php endpoint. Unlike in the old version of this service, different search types can be requested which are mapped to different backends as needed. As a result, the client-facing search call is no longer
searchService.search(params)
, but rathersearchService.search(params, SearchType.METADATA)
orsearchService.search(params, SearchType.FULLTEXT)
. This can be extended to additional search types/backends in the future. Clients will determine the appropriate search type depending on user preference or other factors.The PPS responses are structured differently than the ones from advanced_search.php, necessitating many changes to how the raw responses are mapped to our models. These changes occur largely in the
/src/responses/*
classes.In particular, the PPS may return different types of search "hits" each conforming to their own schema. The two currently-implemented hit types are
item
(from Metadata searches) andtext
(from Full Text searches). These are modeled under/src/models/hit-types
. These hits are modeled similarly to the existingMetadata
class, with readonly optional fields to reflect the fact that most metadata fields are not guaranteed to be present on the hits, and the client should not make undue assumptions about whether a given field is defined.In keeping with this, the
Hit
interface presented within client-facing responses is agnostic of exactly which type of hit was returned -- though clients may determine this from the returned hit schema if necessary (e.g., if rendering details differ depending on the type of hits returned).Lastly, the previous version of the search service had additional methods for fetching all metadata for a single item. This PR removes this functionality entirely as it has been moved to the iaux-metadata-service package for a cleaner separation of responsibilities. Clients that rely on the
fetchMetadata
andfetchMetadataValue
methods will need to migrate to this new dependency before upgrading to the new search service.